# 导包
from selenium import webdriver
import time

from selenium.webdriver.common.by import By


class Testcase:
    def __init__(self):
        self.driver = webdriver.Chrome()

    def get(self):
        self.driver.get('https://www.zhipin.com')
        query = self.driver.find_element(By.NAME, 'query')
        query.send_keys('产品经理')
        search = self.driver.find_element(By.CLASS_NAME, 'btn-search')
        search.click()

    def print_title(self):
        time.sleep(3)
        print(self.driver.title)

    def quit(self):
        time.sleep(3)
        self.driver.quit()

    def window_max(self):
        time.sleep(2)
        self.driver.set_window_size(400, 800)
        time.sleep(2)
        self.driver.maximize_window()
        time.sleep(2)
        self.driver.minimize_window()

    def refresh(self):
        time.sleep(2)
        self.driver.refresh()

    def forward_back(self):
        time.sleep(2)
        self.driver.back()
        time.sleep(2)
        self.driver.forward()


if __name__ == '__main__':
    case = Testcase()
    case.get()
    case.print_title()
    case.quit()